package MySwing;

import java.awt.BorderLayout;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.TableModel;


public abstract class JMyGrid extends JPanel {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	protected BorderLayout layout;
	private JTable table;
	JScrollPane scrollPane;
	public JMyGrid(TableModel tb)
	{
		this();
		table.setModel(tb);
	}
	public JMyGrid()
	{
    	layout = new BorderLayout();
 		setLayout(layout);
		table = new JTable();
		JScrollPane scrollPane = new JScrollPane(table);
		table.setFillsViewportHeight(true);
		add(scrollPane,BorderLayout.CENTER);
	}
	public void Refresh(TableModel tb)
	{
		table.setModel(tb);
	}
	public JTable getTable()
	{
		return this.table;
	}
}


